<? 
	$title="User List"; 
	$pageid="4";
	$accessid=",a10,";

	if(isset($_POST['btnsubmit']))
	{
		require("required/dbconnect.php");
		
		$ebank_allowed=$_POST['ebank_allowed'];
		$paypal_emailaddress=$_POST['paypal_emailaddress'];
		$paypal_submit_url=$_POST['paypal_submit_url'];
		$paypal_allowed=$_POST['paypal_allowed'];
		$paypal_returnurl=$_POST['paypal_returnurl'];
		$paypal_pdt_token=$_POST['paypal_pdt_token'];	
		$paypal_logo_url=$_POST['paypal_logo_url'];
			
		$update=mysql_query("update os_contactinfo set ebank_allowed='$ebank_allowed', paypal_emailaddress='$paypal_emailaddress',paypal_submit_url='$paypal_submit_url',paypal_allowed='$paypal_allowed',paypal_returnurl='$paypal_returnurl',paypal_pdt_token='$paypal_pdt_token',paypal_logo_url='$paypal_logo_url' where id=1")or die(mysql_error());
		
		
		header("Location:sys_payment.php?msg=1");
	}
	
	require("required/dbconnect.php"); 
	require("required/function.php");
	require("required/header.php");
	
	checkAccess("allow_content_management",1);
?>
<script src="required/js/jquery-1.4.2.js"></script>
<script src="required/js/common_javascript.js"></script>
<?
	if(empty($_GET['msg']))
	{
		$msg="";
	}
	else
	{
		$msg="<div class='dw_success'>Data updated!</div>";
		echo "<script>displayMsg('divMsg')</script>";	
	}
	
	
	$get_info=mysql_query("select * from os_contactinfo where id=1");
	
	$a=mysql_fetch_array($get_info,MYSQL_ASSOC);
	
	
?>
<table width="100%"  cellpadding="0" cellspacing="5" height="300">
<tr>
	

	<td valign="top">
			<div id="divMsg"><?= $msg ?></div>
			<form action="<?= $_SERVER['PHP_SELF'] ?>" method="post">
			<table width="100%">
				
				<tr>
					<td colspan="3" class="title">
					<strong>Payment Settings</strong>
					</td>
				</tr>
                <?
					if($a['ebank_allowed']==0)
					{
						$eb_slt1="";
						$eb_slt2="selected";
					}else{
						$eb_slt1="selected";
						$eb_slt2="";
					}	
				?>
				<tr>
					<td>Pay By E Banking</td>
					<td><select name="ebank_allowed">
							<option value="1" <?= $eb_slt1 ?>>Allowed</option>
							<option value="0" <?= $eb_slt2 ?>>Not Allowed</option>
						</select>
					</td>
				</tr>
				
				<?
					if($a['paypal_allowed']==0)
					{
						$pp_slt1="";
						$pp_slt2="selected";
					}else{
						$pp_slt1="selected";
						$pp_slt2="";
					}	
				?>
				<tr>
					<td>Pay By Paypal</td>
					<td><select name="paypal_allowed">
							<option value="1" <?= $pp_slt1 ?>>Allowed</option>
							<option value="0" <?= $pp_slt2 ?>>Not Allowed</option>
						</select>
					</td>
				</tr>
              
				
				
				
				<tr>
					<td colspan="3">
					<br><br>
					<strong><img src="../images/p1.gif" align="absmiddle"> Setting</strong>
					<br>
					<hr style="height:1px;color:#000000">
					</td>
				</tr>
				<tr>
					<td>Paypal Email Address</td><td><input type="text" value="<?= $a['paypal_emailaddress'] ?>" name="paypal_emailaddress" maxlength="100" size="50"></td>
				</tr>
				<tr valign="top">
					<td>Paypal Submit URL</td><td><input type="text" value="<?= $a['paypal_submit_url'] ?>" name="paypal_submit_url" maxlength="100" size="70">
					<br>
					Paypal sandbox : https://www.sandbox.paypal.com/cgi-bin/webscr<br>
					Paypal live : https://www.paypal.com/cgi-bin/webscr
					</td>
				</tr>
                <tr>
					<td>Return URL</td><td><input type="text" value="<?= $a['paypal_returnurl'] ?>" name="paypal_returnurl" maxlength="100" size="50"></td>
				</tr>
                 <tr>
					<td>PDT Token</td><td><input type="text" value="<?= $a['paypal_pdt_token'] ?>" name="paypal_pdt_token" maxlength="100" size="50"></td>
				</tr>
                 <tr>
					<td>Logo URL</td><td><input type="text" value="<?= $a['paypal_logo_url'] ?>" name="paypal_logo_url" maxlength="100" size="50"> (150 x 50)</td>
				</tr>
				<td width="34%">
					
					<input type="submit" value="Save" class="button" name="btnsubmit">
				</td>
			</table>
			</form>
		</td>
	</tr>
	
	
</table>
<? require("required/footer.php"); ?>

